<template>
  <div class="app-container">
    <div class="maindiv">
      <!-- {{ e }} -->
      <div class="ces-main">
        <!-- style=" width: 350px;position: absolute;top: -2px;right: -20px;" -->
        <!-- style="position: absolute;top: 5px;right: 2px;top:8px" -->
        <Search-Form ref="form" size="mini" labelWidth="50px" :searchData="SearchGroup" :tableCols="tableCols"
          :searchHandle="searchHandle" @handleEnter="refresh"></Search-Form>
        <v-GetToolBar style="position: absolute;right: 2px;top:11px" align="right" :key="MenuCode" :MenuCode="MenuCode"
          :IsfunEdit="IsfunEdit" :Isfunfail="Isfunfail" @handeAdd="handeAdd" @handleEdit="handleEdit"
          @OpenFindForm="searchTop" @handlexportData="handlexportData" @IsfunEdit="handleIsfunEdit"
          @IsfunDelete="handleIsfunfail" @handleclose="handleclose"></v-GetToolBar>

        <ces-table :ToolBarheight="ToolBarheight" size="mini" :isSelection="true" :isIndex="true" :isSearch="true"
          :isHandle="false" :IsfunEdit="IsfunEdit" :Isfunfail="Isfunfail" :tableData="tableData" :tableCols="tableCols"
          :Search="SearchGroup" @refresh="refresh" @handleEdit="handleEdit" @handleDelete="delData"
          @handrowclick="handrowclick" @select="selectMata" @selectAll="selectMata">
        </ces-table>
      </div>

      <div class="midMain">
        <div>
          <Search-Form ref="form" size="mini" labelWidth="50px" :searchData="SearchGroupInfo" :tableCols="tableColsInfo"
            :searchHandle="searchHandle" @handleEnter="refresh"></Search-Form>
        </div>

        <div class="botonRight">
          <el-button type="primary" icon="el-icon-search" size="mini" @click="searchDown">查询</el-button>
          <el-button v-if="activeName === 'first'" type="success" icon="el-icon-sort" size="mini"
            @click="configure">关联</el-button>
        </div>

        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="工艺" name="first"><ces-table :flag="false" :ToolBarheight="ToolBarheight2" size="mini"
              :isSelection="false" :isIndex="true" :isSearch="true" :isHandle="false" :IsfunEdit="IsfunEdit"
              :Isfunfail="Isfunfail" :tableData="tableDataTechnique" :tableCols="tableColsTechnique"
              :Search="SearchTechnique" :key="key" @refresh="refresh" @handleEdit="handleEditInfo"
              @handleDelete="delDataInfo" @handrowclick="handrowclickTechnique">
            </ces-table></el-tab-pane>
          <el-tab-pane label="工序" name="second"><ces-table :flag="false" :ToolBarheight="ToolBarheight2" size="mini"
              :isSelection="false" :isIndex="true" :isSearch="true" :isHandle="false" :IsfunEdit="true"
              :Isfunfail="true" :tableData="tableDataProcedure" :tableCols="tableColsProcedure"
              :Search="SearchProcedure" :key="key" @refresh="refresh" @handleEdit="handleEditDown($event, 2)"
              @handleDelete="delProcedure" @handrowclick="handrowclick">
            </ces-table></el-tab-pane>
          <el-tab-pane label="产能" name="third"><ces-table :flag="false" :ToolBarheight="ToolBarheight2" size="mini"
              :isSelection="false" :isIndex="true" :isSearch="true" :isHandle="false" :IsfunEdit="true"
              :Isfunfail="true" :tableData="tableDataCapacity" :tableCols="tableColsCapacity" :Search="SearchCapacity"
              :key="key" @refresh="refresh" @handleEdit="handleEditDown($event, 3)" @handleDelete="delDataInfo"
              @handrowclick="handrowclick">
            </ces-table></el-tab-pane>
        </el-tabs>
      </div>
    </div>

    <!--搜索弹框-->
    <el-dialog title="搜索" :visible.sync="SearchDialog" custom-class="dialogClass" class="searchDialog" center
      ref="searchDialog" :modal="false" :close-on-click-modal="true">
      <el-form :model="SearchGroup" label-width="90px" ref="searchForm">
        <Search-Form ref="form" :frame="true" size="mini" labelWidth="50px" :searchData="Search" :tableCols="tableCols"
          :searchHandle="searchHandle" @handleEnter="refresh"></Search-Form>
      </el-form>
      <div slot="footer" :style="{ 'margin-buttom': 0 == 0 ? DialogBtnMargin : DialogBtnMargin }">
        <el-button @click="reform()">重置</el-button>
        <el-button type="primary" @click="refresh()">确 定</el-button>
      </div>
    </el-dialog>

    <el-dialog v-if="dialogVisible" :visible.sync="dialogVisible" width="800px" top="20px">
      <!-- {{this.FormData}} -->
      <el-form :model="name" label-width="80px" label-position="right">
        <el-tabs type="border-card">
          <el-tab-pane label="">
            <el-form :model="FormData" label-width="90px" ref="MianForm">
              <Mian-Form ref="form" labelWidth="100px" :FormData="FormData" :tableCols="tableCols" :StepSN="0"
                :searchHandle="searchHandle"></Mian-Form>
            </el-form>
          </el-tab-pane>
          <div style="float:right ">
            <el-button type="primary" @click="handleOpenClose()">关闭</el-button>
            <el-button type="primary" @click="handleSave()">保存</el-button>
          </div>
        </el-tabs>
      </el-form>
    </el-dialog>

    <el-dialog v-if="dialogVisibleInfo" :visible.sync="dialogVisibleInfo" width="800px" top="20px">
      <el-form :model="name" label-width="80px" label-position="right">
        <el-tabs type="border-card">
          <el-tab-pane label="">
            <el-form :model="FormDataInfo" label-width="90px" ref="MianForm">
              <!-- {{ see }} -->
              <Mian-Form ref="form" labelWidth="100px" :FormData="FormDataInfo" :tableCols="tableColsInfo" :StepSN="0"
                :searchHandle="searchHandle"></Mian-Form>
            </el-form>
          </el-tab-pane>
          <div style="float:right ">
            <el-button type="primary" @click="handleOpenClose">关闭</el-button>
            <el-button type="primary" @click="handleSaveInfo">保存</el-button>
          </div>
        </el-tabs>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
//引入组件

import cesTable from "../Common//ComVxeTable.vue";
// import cesTable from "../Common//table.vue";
import SearchForm from "../Common//Search.vue";
import MianForm from "../Common//form.vue";

import { funDownload, funDownloadv1, GetTableColsData } from "@/api/Common";
import {
  getDataList,
  DeleteForm,
  CloseForm,
  UpdateForm,
  getfunDownload,
  MenuUpdate,
} from "@/api/CommonPage/CommonPage"; //更改
import vGetToolBar from "../Common/GetToolBar";

export default {
  name: "CategoryInfo",
  data() {
    //表单查询一般分为input，下拉框，和日期，下面是下拉框时的设置下拉信息的情况，我的项目没有用到，但是留着方便看

    return {
      activeName: "first",
      key: 1,
      see: [],
      input: "",
      ToolBarheight: null,
      ToolBarheight2: null,
      Id: null,
      index: null,
      StagingDataInfo: null,
      technologyID: null,
      FormDataInfo: [],
      dialogVisibleInfo: false,
      MenuCode: "",
      tableData: [], //表格数据
      tableCols: [], //表格列数据
      FormData: [], //表格数据
      tableColsInfo: [],
      tableDataInfo: [],
      tableDataTechnique: [],
      tableColsTechnique: [],
      tableDataProcedure: [],
      tableColsProcedure: [],
      tableDataCapacity: [],
      tableColsCapacity: [],
      searchHandle: [],
      billID: "",
      IsfunEdit: false,
      Isfunfail: false,
      SearchGroupInfo: {},
      SearchGroup: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 100, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1630", // 表编号  根据Controller中对应的表编号
        InterID: "1630",
        jsWhere: "", // 自定义条件
        Download: "",
        YearMonth: "",
        OrganizeID: "",
        LineName: "",
        IsFieldText: "0",
        // Status: 0,
        //   BillState: "BillStateALL",
      },
      SearchTechnique: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 100, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1594", // 表编号  根据Controller中对应的表编号 //更改
        InterID: "1594",
        jsWhere: "", // 自定义条件
        Download: "",
        WorkingDate: [],
        IsFieldText: "0",
        OrganizeID: "",
      },
      SearchProcedure: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 100, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1588", // 表编号  根据Controller中对应的表编号 //更改
        InterID: "1588",
        jsWhere: "", // 自定义条件
        Download: "",
        WorkingDate: [],
        IsFieldText: "0",
        OrganizeID: "",
      },
      SearchCapacity: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 100, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1628", // 表编号  根据Controller中对应的表编号 //更改
        InterID: "1628",
        jsWhere: "", // 自定义条件
        IsFieldText: "0",
        Download: "",
      },
      SearchTechnology: {
        // 查询条件
        total: 0, // 总记录数
        pageSize: 100, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1631", // 表编号  根据Controller中对应的表编号 //更改
        InterID: "1631",
        IsFieldText: "0",
        jsWhere: "", // 自定义条件
        Download: "",
      },

      cities: [
        {
          value: "ALL",
          label: "ALL",
        },
        {
          value: "0",
          label: "草稿",
        },
        {
          value: "1",
          label: "审核中",
        },
        {
          value: "2",
          label: "结案",
        },
        {
          value: "3",
          label: "作废",
        },
      ],
      BillStatecities: [
        {
          value: "BillStateALL",
          label: "ALL",
        },
        {
          value: "0",
          label: "未完成",
        },
        {
          value: "2",
          label: "已完成",
        },
      ],
      SearchDialog: false,
      DialogBtnMargin: 0,
      dialogVisible: false,
      valueID: "",
    };
  },

  components: {
    //引入组件后注册组件
    cesTable,
    vGetToolBar,
    SearchForm,
    MianForm,
  },
  mounted() {
    this.ToolBarheight = parseInt(document.documentElement.clientHeight * 0.67);
    this.ToolBarheight2 = parseInt(
      document.documentElement.clientHeight * 0.72
    );
    this.getDataList();
    this.getDataListThree();

    //下表查询
    this.SearchGroupInfo = this.SearchTechnique;
    this.tableColsInfo = this.tableColsTechnique;
  },

  methods: {
    async searchTop() {
      const res = await getDataList({ data: JSON.stringify(this.SearchGroup) });
      this.SearchGroup.total = res.data.Table1[0].RecordCount;
      this.tableData = res.data.Table;
    },
    async searchDown() {
      const res = await getDataList({
        data: JSON.stringify(this.SearchGroupInfo),
      });
      this.SearchGroupInfo.total = res.data.Table1[0].RecordCount;
      if (this.SearchGroupInfo.InterID == 1594)
        this.tableDataTechnique = res.data.Table;
      if (this.SearchGroupInfo.InterID == 1588)
        this.tableDataProcedure = res.data.Table;
      if (this.SearchGroupInfo.InterID == 1628)
        this.tableDataCapacity = res.data.Table;
    },
    handrowclickTechnique({ row }) {
      this.valueID = row.ProcessGroupID;
    },
    selectMata(data) {
      this.selectData = data;
    },
    //配置工艺
    configure() {
      let flag = false;
      let result1;
      this.selectData.forEach(async (obj) => {
        //查询更改
        let data = {
          ProcessGroupMaterialID: obj.ProcessGroupMaterialID,
          // MaterialID: obj.MaterialID,
          // ProcessGroupID: this.valueID,
          // Status: 1,
        };

        const result = await UpdateForm({
          IsPostBack: false,
          InterID: this.SearchTechnology.InterID,
          SavaDate: JSON.stringify(data),
        });

        result.data1.Table[0].MaterialID = obj.MaterialID;
        result.data1.Table[0].ProcessGroupID = this.valueID;
        result.data1.Table[0].Status = 1;
        result1 = await UpdateForm({
          IsPostBack: true,
          InterID: this.SearchTechnology.InterID,
          SavaDate: JSON.stringify(result.data1.Table[0]),
        });
        // debugger
        if (result1.code === 20000) {
          flag = true;
        }
      });
      setTimeout(async () => {
        if (flag) {
          this.$notify({
            title: result1.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "success",
          });
          const res = await getDataList({ data: JSON.stringify(this.SearchGroup) });
          this.SearchGroup.total = res.data.Table1[0].RecordCount;
          this.tableData = res.data.Table;
          // this.getDataList();
          // this.selectMata();
        } else {
          this.$notify({
            title: result1.msg,
            dangerouslyUseHTMLString: true,
            message: "",
            type: "error",
          });
        }
      }, 1500);
    },
    handleClick({ index }) {
      if (index == 0) {
        this.SearchGroupInfo = this.SearchTechnique;
        this.tableColsInfo = this.tableColsTechnique;
      }
      if (index == 1) {
        this.SearchGroupInfo = this.SearchProcedure;
        this.tableColsInfo = this.tableColsProcedure;
      }
      if (index == 2) {
        this.SearchGroupInfo = this.SearchCapacity;
        this.tableColsInfo = this.tableColsCapacity;
      }
    },
    async handleEditDown({ row }, num) {
      if (num === 2) {
        this.dialogVisibleInfo = true;
        const result = await UpdateForm({
          IsPostBack: false,
          InterID: this.SearchProcedure.InterID,
          SavaDate: JSON.stringify(row),
        });
        this.FormDataInfo = result.data1.Table[0];
        this.tableColsInfo = this.tableColsProcedure;
      }
      if (num === 3) {
        this.dialogVisibleInfo = true;
        const result = await UpdateForm({
          IsPostBack: false,
          InterID: this.SearchCapacity.InterID,
          SavaDate: JSON.stringify(row),
        });
        this.FormDataInfo = result.data1.Table[0];
        this.tableColsInfo = this.tableColsCapacity;
      }
    },
    refresh() {
      this.getDataList();
    },

    addTableDataInfo() {
      let data = {
        ProcessGroupInfoID: null,
        ProcessID: null,
        ProcessGroupID: this.technologyID,
        IsScheduling: null,
        PostProcessID: null,
        FixDay: null,
        AcquisitionTimes: null,
        OrganizeID: null,
        CreatedByName: null,
        ModifiedByName: null,
        CreatedOn: null,
        ModifyedOn: null,
      };
      this.FormDataInfo = data;
      this.dialogVisibleInfo = true;
    },

    async addTableData() {
      let data = {
        ProcessGroupID: null,
        ProcessGroupName: null,
        OrganizeID: null,
        Status: null,
        CreatedBy: null,
        CreatedByName: null,
        ModifiedBy: null,
        ModifiedByName: null,
        CreatedOn: null,
        ModifyedOn: null,
        Remark1: null,
        Remark2: null,
        ByRegion: null,
        SchedulingSeq: null,
      };
      this.FormData = data;
      this.dialogVisible = true;
    },

    reform() {
      this.SearchGroup = {
        // 查询条件
        // total: 0, // 总记录数
        pageSize: 13, // 一页显示的记录数
        page: 1, // /当前页码
        RNO: "1626", // 表编号  根据Controller中对应的表编号 //更改
        InterID: "1626",
        jsWhere: "", // 自定义条件
        Download: "",
        //   Status: 0,
        //   BillState: "BillStateALL",
      };
      // this.Search.InterID = this.InterID;
      // this.Search.RNO = this.InterID;
      this.getDataList();
    },

    async getDataList() {
      //表头数据

      const res = await getDataList({ data: JSON.stringify(this.SearchGroup) });
      this.SearchGroup.IsFieldText = "1";
      this.SearchGroup.total = res.data.Table1[0].RecordCount;
      this.tableData = res.data.Table;
      this.tableCols = res.data1;

      this.SearchGroupInfo.jsWhere = `and  1 = 2`;
      const resCols = await getDataList({
        data: JSON.stringify(this.SearchGroupInfo),
      });
      this.SearchGroupInfo.IsFieldText = "1";
      this.tableColsInfo = resCols.data1;
      this.SearchGroupInfo.jsWhere = "";
    },

    async getDataListThree() {
      //表头数据
      const res1 = await getDataList({
        data: JSON.stringify(this.SearchTechnique),
      });
      this.SearchTechnique.IsFieldText = "1";
      this.SearchTechnique.total = res1.data.Table1[0].RecordCount;
      this.tableDataTechnique = res1.data.Table;
      this.tableColsTechnique = res1.data1;

      const res2 = await getDataList({
        data: JSON.stringify(this.SearchProcedure),
      });
      this.SearchProcedure.IsFieldText = "1";
      this.SearchProcedure.total = res2.data.Table1[0].RecordCount;
      this.tableDataProcedure = res2.data.Table;
      this.tableColsProcedure = res2.data1;

      const res3 = await getDataList({
        data: JSON.stringify(this.SearchCapacity),
      });
      this.SearchCapacity.IsFieldText = "1";
      this.SearchCapacity.total = res3.data.Table1[0].RecordCount;
      this.tableDataCapacity = res3.data.Table;
      this.tableColsCapacity = res3.data1;
    },

    OpenFindForm() {
      // alert(JSON.stringify(this.tableCols))
      //打开搜索框
      this.SearchDialog = true;
      //计算外边距
      console.log(this.$refs.searchDialog.offsetHeight);
      this.DialogBtnMargin = this.$refs.searchDialog.offsetHeight - 40;
    },

    async handlexportData() {
      this.SearchGroup.Download = "1";
      const res = await getfunDownload({
        data: JSON.stringify(this.SearchGroup),
      });
      this.SearchGroup.Download = "0";
      funDownloadv1(res); //更改
    },

    handleIsfunEdit() {
      this.IsfunEdit = true;
    },
    handleIsfunfail() {
      this.Isfunfail = true;
    },
    async handeAdd() {
      // 新建

      const result = await UpdateForm({
        IsPostBack: false,
        InterID: this.InterID,
      });
      this.FormData = result.data1.Table[0];
      this.dialogType = "edit";
      this.dialogVisible = true;
      this.checkStrictly = true;

      this.$nextTick(() => {
        const routes = this.generateRoutes(this.EditObj.routes);
        this.$refs.tree.setCheckedNodes(this.generateArr(routes));
        // set checked state of a node not affects its father and child nodes
        this.checkStrictly = false;
      });
      this.getDataList();

      // let routeUrl = this.$router.push({
      //   path: "/MesPieceWork/CompleteProcedureRoportForm",//更改
      //   query: { billID: "", IsPostBack: false },
      // });
      // window.open(routeUrl.path, "_top");
    },
    async handleEdit(scope) {
      // alert(scope.row)
      // 修改
      this.dialogVisible = true;
      const result = await UpdateForm({
        IsPostBack: false,
        InterID: this.SearchGroup.InterID,
        SavaDate: JSON.stringify(scope.row),
      });
      this.FormData = result.data1.Table[0];
      // alert(JSON.stringify(this.FormData))
      this.dialogType = "edit";
      this.checkStrictly = true;
      this.$nextTick(() => {
        const routes = this.generateRoutes(this.EditObj.routes);
        this.$refs.tree.setCheckedNodes(this.generateArr(routes));
        this.checkStrictly = false;
      });
      this.getDataList();
    },

    async handleEditInfo(scope) {
      this.index = scope.$index;
      // alert(this.index)
      // 修改
      this.dialogVisibleInfo = true;
      const result = await UpdateForm({
        IsPostBack: false,
        InterID: this.SearchGroupInfo.InterID,
        SavaDate: JSON.stringify(scope.row),
      });
      this.FormDataInfo = result.data1.Table[0];
      this.dialogType = "edit";
      this.checkStrictly = true;
      this.$nextTick(() => {
        const routes = this.generateRoutes(this.EditObj.routes);
        this.$refs.tree.setCheckedNodes(this.generateArr(routes));
        // set checked state of a node not affects its father and child nodes
        this.checkStrictly = false;
      });
      this.getDataList();
    },

    async handleSave() {
      // 修改
      const result = await UpdateForm({
        IsPostBack: true,
        InterID: this.SearchGroup.InterID,
        SavaDate: JSON.stringify(this.FormData),
      });
      // alert(JSON.stringify(this.FormData))
      this.FormData = result.data1.Table[0];
      if (result.code === 20000) {
        this.$notify({
          title: result.msg,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "success",
        });
        const reCode = await getDataList({
          data: JSON.stringify(this.SearchGroupInfo),
        });
        this.tableDataInfo = reCode.data.Table;
      } else {
        this.$notify({
          title: result.msg,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "error",
        });
      }
      this.dialogVisible = false;
    },

    async handleSaveInfo() {
      // 修改
      const result = await UpdateForm({
        IsPostBack: true,
        InterID: this.SearchGroupInfo.InterID,
        SavaDate: JSON.stringify(this.FormDataInfo),
      });
      this.FormDataInfo = result.data1.Table[0];

      if (this.activeName === 'second') {
        const resInfo = await getDataList({
          data: JSON.stringify(this.SearchGroupInfo),
        });
        this.tableDataProcedure = resInfo.data.Table;
        this.SearchGroupInfo.total = resInfo.data.Table1[0].RecordCount;
      }
      if (this.activeName === 'third') {
        const resInfo = await getDataList({
          data: JSON.stringify(this.SearchCapacity),
        });
        this.tableDataCapacity = resInfo.data.Table;
        this.SearchCapacity.total = resInfo.data.Table1[0].RecordCount;
      }


      if (result.code === 20000) {
        this.$notify({
          title: result.msg,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "success",
        });

      } else {
        this.$notify({
          title: result.msg,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "error",
        });
      }
      this.dialogVisibleInfo = false;
      // alert(222)
    },

    async delData({ $index, row }) {
      this.$confirm("删除操作, 是否继续?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
      })
        .then(async () => {
          const result = await DeleteForm({
            InterID: this.SearchGroup.InterID,
            SavaDate: JSON.stringify(row),
            IsPostBack: false,
          });
          this.getDataList();
          // this.tableData.splice($index, 1);
          this.$message({
            type: "success",
            message: result.msg,
          });
        })
        .catch((err) => {
          console.error(err);
        });
    },
    delProcedure({ row }) {
      this.$confirm("删除操作, 是否继续?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
      })
        .then(async () => {
          const result = await DeleteForm({
            InterID: this.SearchProcedure.InterID,
            SavaDate: JSON.stringify(row),
            IsPostBack: false,
          });
          const resInfo = await getDataList({
            data: JSON.stringify(this.SearchProcedure),
          });
          this.tableDataProcedure = resInfo.data.Table;
          this.$message({
            type: "success",
            message: result.msg,
          });
        })
        .catch((err) => {
          console.error(err);
        });
    },
    delDataInfo({ $index, row }) {
      this.$confirm("删除操作, 是否继续?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
      })
        .then(async () => {
          const result = await DeleteForm({
            InterID: this.SearchGroupInfo.InterID,
            SavaDate: JSON.stringify(row),
            IsPostBack: false,
          });
          // this.tableData.splice($index, 1);
          const resInfo = await getDataList({
            data: JSON.stringify(this.SearchGroupInfo),
          });
          this.StagingDataInfo = resInfo.data.Table;
          let data = this.StagingDataInfo.filter(
            (v) => v.ProcessGroupID == this.Id
          );
          this.tableDataInfo = data;
          // this.getDataList();
          this.$message({
            type: "success",
            message: result.msg,
          });
        })
        .catch((err) => {
          console.error(err);
        });
    },

    async handrowclick(row) {
      //   if (row !== 0) {
      //     this.Id = row.row.OrganizeID;
      //     this.SearchGroupInfo.OrganizeID = row.row.OrganizeID;
      //   }
      //   // debugger
      //   this.SearchGroupInfo.jsWhere = "";
      //   const resInfo = await getDataList({
      //     data: JSON.stringify(this.SearchGroupInfo),
      //   });
      //   this.SearchGroupInfo.total = resInfo.data.Table1[0].RecordCount;
      //   this.tableDataInfo = resInfo.data.Table;
      //   this.tableColsInfo = resInfo.data1;
      //   this.technologyID = row.ProcessGroupID;
      // this.key = this.key === 1 ? this.key + 1 : 2
    },

    handleOpenClose() {
      this.dialogVisible = false;
      this.dialogVisibleInfo = false;
    },
    handleclose() {
      if (this.billID != "") {
        this.$confirm("关单操作, 是否继续? 订单号：" + this.billID, "提示", {
          confirmButtonText: "确认",
          cancelButtonText: "取消",
        })
          .then(async () => {
            const result = await CloseForm({
              billID: this.billID,
              types: 1,
              IsPostBack: false,
            });
            this.getDataList();
            this.$message({
              type: "success",
              message: result.msg,
            });
          })
          .catch((err) => {
            console.error(err);
          });
      } else {
        this.$notify({
          title: "关单操作，请选择数据" + this.billID,
          dangerouslyUseHTMLString: true,
          message: "",
          type: "error",
        });
      }
    },
  },
};
</script>

<style lang="scss" scoped>
.app-container {
  width: 100%;
  overflow: hidden;

  /deep/ .el-tabs__nav {
    float: right !important;
    margin-right: 8px;
  }

  .EditObjs-table {
    margin-top: 30px;
  }

  .permission-tree {
    margin-bottom: 5px;
  }

  .maindiv {
    display: flex;
    flex-wrap: wrap;
    width: 100%;

    .ces-main {
      position: relative;
      flex: 1;
      width: 80vw;
      overflow: outo;
    }

    .midMain {
      padding-top: 12px;
      width: 80vw;
      flex: 1;
      position: relative;

      .botonRight {
        position: absolute;
        right: 2px;
        top: 23px;
      }

      .GetToolBar {
        position: absolute;
        right: 2px;
        top: 23px;
      }
    }
  }
}

.searchDialog ::v-deep .el-dialog__header {
  background: #409eff;
}

.searchDialog ::v-deep .el-dialog__title {
  color: #fff;
}

.searchDialog ::v-deep .el-dialog__headerbtn .el-dialog__close {
  color: #fff;
}
</style>
